#define INCLUDE_TEMPLATE_SOURCE 1

#define DXUTMODLEVIEWCAMERA	1
#define PARALLEL_LIGHT	0

#define UNIFORM_KNOT 1
#define SORT_SHARE   1


#define ONEPATCH 0

#if ONEPATCH
#define TEST	1
#define EXIST_CONTOUR 1
#else
#define TEST	0
#define EXIST_CONTOUR 0
#endif

#define MC_WITH_NORMAL 1

#define TICTOC    0

#define NOPOINT			0.0f
#define REGULARPOINT	1.0f


#define SilContour		0.50f

#define HorVerSil		0.30f
#define AllEdge			0.25f
#define HorSil			0.20f
#define HorVerEdge		0.15f
#define VerSil			0.10f
#define NoneEdge		0.05f

#define IsSil(x)	(x>NoneEdge&&x<SilContour)
#define IsCon(x)	(x>1.0f-SilContour&&x<1.0f-NoneEdge)

#define IsHorVerSil(x) (x>AllEdge&&x<SilContour)
#define IsHorSil(x) (x>HorVerEdge&&x<SilContour)
#define IsVerSil(x)	((x<HorVerEdge&&x>NoneEdge)||(x>AllEdge&&x<SilContour))
#define IsHorCon(x) (x<1.0f-HorVerEdge&&x>1.0f-SilContour)
#define IsVerCon(x) ((x>1.0f-HorVerEdge&&x<1.0f-NoneEdge)||(x<1.0f-AllEdge&&x>1.0f-silC))


#define ERROR_FUNC_EPS	1.0e-6
#define  IntervalEPS    2.0e-4f

#define PIXELTHREADS	64

#define MAX_FIND_RESULT 70
#define MAX_NAME_LEN	50


#define DERIVATIVE_DELTA		0.0001f
#define DERIVATIVE_DELTA_INV	(1.0e4)

#define XYZ(x)			for(int _i_=0; _i_<3; _i_++) {x}

#define DELETEARR(x)		{if(x) delete [](x); x=NULL;}




#define  PI						3.14159265358979

#define MAX_SING_PT 10

#define  MAX_DEG_ROOT_FINDING_CPU			 20//9
#define  MAX_DEG_ABS			 20//9
#define  MAX_DEG_GAS			 12//9



